// index.js
Page(
  {
  num1change:function(e){
  this.num1=Number(e.detail.value)
},
num2change:function(e){
  this.num2=Number(e.detail.value)
},
compare: function() {
  var str = '两数相等'
  if (this.num1 > this.num2) {
    str = '第1个数大'
  } else if (this.num1 < this.num2) {
    str = '第2个数大'
  }
  this.setData({result: str})
},
})

